#ifndef ArgvH
#define ArgvH
#include <string>
#include <vector>
#include "StringEx.h"
class Argv
{
public:
	Argv(std::string cmd = "")
	{
		stringSplit(m_vec, cmd, " ");
	}

	virtual ~Argv() {}

	size_t count() { return m_vec.size(); }
	
	std::string operator[](size_t index)
	{
		if (index < m_vec.size())
			return m_vec[index];
		else
			return m_vec[m_vec.size() - 1];
	}

	void operator=(const std::string cmd) 
	{
		m_vec.clear();
		stringSplit(m_vec, cmd, " ");
	}

protected:
private:
	std::vector<std::string> m_vec;
};

#endif // !ArgcH

